#include "Games.h"
#include <QKeyEvent>
#include "../Demos/Snake/Snake.h"
#include "../Demos/MultiSnake/MultiSnake.h"


Games::Games(QWidget* parent)
	: QMainWindow(parent)
{
	ui.setupUi(this);
}

Games::~Games()
{
}

void Games::setWidget(QWidget* child) {
	this->widget = child;
}


void Games::keyPressEvent(QKeyEvent* event) {
	if (NULL != this->widget) {
		((Snake*)(this->widget))->keyEvent(event);
	}
	qDebug() << "key:" << event->key();
}
